﻿using System.Text;

namespace Ex03.GarageLogic
{
    public class GarageClient
    {
        public enum eProcessStatus
        {
            Fixing = 1,
            Fixed,
            Payed
        }

        private const string k_NameKey = "Name";
        private const string k_PhoneNumberKey = "Phone Number";
        private const string k_ProcessStatusKey = "Process Status";

        private string m_Name;
        private string m_PhoneNumber;
        private eProcessStatus m_ProcessStatus;
        private Vehicle m_Vehicle;

        public GarageClient()
        {
            m_ProcessStatus = eProcessStatus.Fixing;
        }

        public GarageClient(string i_Name, string i_PhoneNumber)
        {
            m_Name = i_Name;
            m_PhoneNumber = i_PhoneNumber;
            m_ProcessStatus = eProcessStatus.Fixing;
        }

        public Vehicle Vehicle
        {
            get { return m_Vehicle; }
            set { m_Vehicle = value; }
        }

        public eProcessStatus ProcessStatus
        {
            get { return m_ProcessStatus; }
            set { m_ProcessStatus = value; }
        }

        public string Name
        {
            get { return m_Name; }
        }

        public string PhoneNumber
        {
            get { return m_PhoneNumber; }
        }

        public override string ToString()
        {
            StringBuilder stringBuilderResult = new StringBuilder();

            stringBuilderResult.Append(k_NameKey);
            stringBuilderResult.Append(Vehicle.k_ToStirngPairDelimiter);
            stringBuilderResult.Append(Name);
            stringBuilderResult.Append(Vehicle.sr_ToStirngEndOfPairDelimiter);

            stringBuilderResult.Append(k_PhoneNumberKey);
            stringBuilderResult.Append(Vehicle.k_ToStirngPairDelimiter);
            stringBuilderResult.Append(PhoneNumber);
            stringBuilderResult.Append(Vehicle.sr_ToStirngEndOfPairDelimiter);

            stringBuilderResult.Append(k_ProcessStatusKey);
            stringBuilderResult.Append(Vehicle.k_ToStirngPairDelimiter);
            stringBuilderResult.Append(ProcessStatus.ToString());
            stringBuilderResult.Append(Vehicle.sr_ToStirngEndOfPairDelimiter);

            stringBuilderResult.Append(Vehicle.ToString());

            return stringBuilderResult.ToString();
        }
    }
}
